package com.pureut.scheduling.util;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.pureut.common.core.message.RocketMqUtils;
import com.pureut.scheduling.domain.dto.CalendarTeamMqDto;
import com.pureut.scheduling.domain.dto.SchedulingCalendarMqDto;
import org.springframework.beans.factory.annotation.Value;

import java.util.List;

/**
 * @Description 发送管理类（加工商、供应商、客户）
 * @Param MaterialMq
 * @Date 23-02-20
 * @Author hl
 **/
public class SchedulingMqUtil {

    @Value("${rocketmq.name-server}")
    private static String mqServer;

    @Value("${producer.group}")
    private static String mqGroup;

    @Value("${producer.send-message-timeout}")
    private static int mqTimeOut;

    /**
     * 排程工厂日历数据同步发送(mq)
     */
    public static void schedulingCalendarMqSend(SchedulingCalendarMqDto mq) throws Exception {
        ObjectMapper mapper = new ObjectMapper();
        String json = mapper.writeValueAsString(mq);
        RocketMqUtils rocketMqUtils = new RocketMqUtils("192.168.0.93:9876", "producer-system-group", "scheduling_calendar",3000);
        rocketMqUtils.sendMq("producer-system-group",json);
    }

}
